home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
var
/
lib
/
dpkg
/
info
/
wvdial.config
< prev
next >
Wrap
Text File
|
2008-05-19
|
2KB
|
86 lines
#!/bin/sh
set -e
# Source debconf library
. /usr/share/debconf/confmodule
db_capb backup
# Update the Debconf database with information from /etc/wvdial.conf
if [ -e /etc/wvdial.conf ] && type uni >/dev/null 2>/dev/null; then
export UNICONF='ini:/etc/wvdial.conf'
update_db()
{
set +e
RET=`uni get "$1"`
if [ $? ]; then
set -e
db_set "$2" "$RET"
else
set -e
fi
}
else
# We can't do anything
update_db()
{
true
}
fi
STATE=1
LASTSTATE=5
while [ "$STATE" != 0 ] && [ "$STATE" -le "$LASTSTATE" ]; do
case "$STATE" in
1)
db_input low wvdial/wvdialconf || true
;;
2)
db_get wvdial/wvdialconf
if [ "$RET" = "true" ]; then
update_db 'Dialer Defaults/Phone' wvdial/phone
db_input medium wvdial/phone || true
fi
;;
3)
db_get wvdial/wvdialconf
if [ "$RET" = "true" ]; then
update_db 'Dialer Defaults/Username' wvdial/login
db_input medium wvdial/login || true
fi
;;
4)
db_get wvdial/wvdialconf
if [ "$RET" = "true" ]; then
update_db 'Dialer Defaults/Password' wvdial/passphrase
update_db 'Dialer Defaults/Password' wvdial/passphrase2
db_input medium wvdial/passphrase || true
db_input medium wvdial/passphrase2 || true
fi
;;
5)
db_get wvdial/wvdialconf
if [ "$RET" = "true" ]; then
db_get wvdial/passphrase
PASSPHRASE="$RET"
db_get wvdial/passphrase2
if [ "$RET" != "$PASSPHRASE" ]; then
db_input medium wvdial/passphrases_mismatch || true
db_reset wvdial/passphrase
db_reset wvdial/passphrase2
db_fset wvdial/passphrase seen false
db_fset wvdial/passphrase2 seen false
STATE=3
fi
fi
;;
esac
if db_go; then
STATE=$(($STATE + 1))
else
STATE=$(($STATE - 1))
fi
done